'''
定义一个函数，计算所给列表中数之和


def total():
    lst = [1, 6, 5, 98, 1]
    cur = 0
    for i in lst:
        cur += i
    return cur
print(total())
def total1():
    lst = [1, 6, 5, 98, 1]
    cur = sum(lst)
    return cur
print(total1())
'''

'''
定义一个函数，返回指定范围内的所有偶数列表

def Even_number(start,end):
    lst = []
    for i in range(start,end+1):
      if i % 2 == 0:
          lst.append(i)
    return lst
print(Even_number(5,20))
'''


'''
定义一个函数，存在于列表1中的数移除存在于列表2的数

def liebiao():
    lst1 = [1,3,5,7,9]
    lst2 = [7,9]
    lst3 = []
    for i in lst1:
        if i not in lst2 :
                lst3.append(i)
    return lst3
print(liebiao())
更简洁写法
def liebiao():
    lst1 = [1, 3, 5, 7, 9]
    lst2 = [7, 9]
    return [i for i in lst1 if i not in lst2]

print(liebiao())
'''

'''
定义一个函数，对输入的列表进行去重

def list1():
    lst1 = [10,20,30,20,10]
    lst2 = []
    lst2 = list(set(lst1))
    return lst2
print(list1())
'''

'''
定义一个函数，实现两个变量互换操作
def change(a,b):
    return b,a
'''